<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="zh-CN" xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<%@ include file="../common/_new_head.jsp" %>
<div class="content-wrapper">
    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-sm-12">
                <div class="box table-responsive">
                    <table class="table table-striped">

                        <tr>
                            <th>比赛名称</th>
                            <th>参赛人数</th>
                            <th>状态</th>
                            <th>赛制</th>
                            <th>报名时间</th>
                            <th>截止时间</th>
                            <th>对阵情况</th>
                            <th>操作</th>
                        </tr>

                        <tbody>
                        <c:forEach items="${matchs.list}" var="match">
                            <tr>
                                <td style="text-align:left;"><a href="/SignUp/${match.id}-1">${match.name}</a></td>
                                <td style="text-align:left;">${match.signUpNum}/${match.playerNum}</td>
                                <td style="text-align:left;">${match.state}</td>
                                <td style="text-align:left;">${match.type}</td>
                                <td style="text-align:left;">${match.signUpTime}</td>
                                <td style="text-align:left;">${match.closingTime}</td>
                                <td style="text-align:left;">
                                    <c:if test="${match.state!='报名中'&&match.state!='未开始'}"><a
                                        href="/battle/${match.id}">对阵表</a></c:if>
                                </td>
                                <td style="text-align:left;">
                                    <c:if test="${sessionScope.level>'1'&&match.state=='报名中'}"><a
                                        href="/battle/makeBattle/${match.id}">开赛</a></c:if>
                                    <c:if test="${sessionScope.level>'1'&&match.state=='比赛中'}"><a
                                            href="/match/endMatch/${match.id}">结束</a></c:if>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>

                    <c:set var="currentPage" value="${matchs.pageNumber}"/>
                    <c:set var="totalPage" value="${matchs.totalPage}"/>
                    <c:set var="actionUrl" value="/"/>
                    <c:set var="urlParas" value=""/>
                    <%@ include file="../common/_paginate.jsp" %>

                </div>
            </div>
            <!--/.col (right) -->
        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="box box-success">
                    <div class="box-header with-border">
                        <h3 class="box-title">战斗力</h3>
                    </div>
                    <div class="box table-responsive" style="border-top: 0;">
                        <table class="table table-striped">

                            <tr>
                                <th>选手</th>
                                <th>积分</th>
                            </tr>

                            <tbody>
                            <c:forEach items="${players}" var="player">
                                <tr>
                                    <td style="text-align:left;">${player.signName}</td>
                                    <td style="text-align:left;">${player.score}</td>

                                </tr>
                            </c:forEach>
                            </tbody>
                        </table>

                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <div class="box box-success">
                    <div class="box-header with-border">
                        <h3 class="box-title">冠军榜</h3>
                    </div>
                    <div class="box table-responsive" style="border-top: 0;">
                        <table class="table table-striped">

                            <tr>
                                <th>比赛名称</th>
                                <th>冠军</th>
                            </tr>

                            <tbody>
                            <c:forEach items="${champions}" var="champion">
                                <tr>
                                    <td style="text-align:left;">${champion.name}</td>
                                    <td style="text-align:left;">${champion.signName}</td>

                                </tr>
                            </c:forEach>
                            </tbody>
                        </table>

                    </div>
                </div>
            </div>
            <!--/.col (right) -->
        </div>
        <!-- /.row -->

    </section>
    <!-- /.content -->
</div>
<%@ include file="../common/_new_foot.jsp" %>
</html>
